package com.settlement.system.csv;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * @author author
 */
public interface CsvWrite {

    /**
     * 写入数据
     * @param data
     * @throws Exception
     */
    public void write(Object data) throws Exception;

    /**
     * 批量写入数据
     * @param list
     * @throws Exception
     */
    default public void write(List<Object> list) throws Exception {
        for (Object object : list) {
            write(object);
        }
    }

    /**
     *  close 关闭文件
     */
    default public void close(){

    }

    /**
     * getFile
     * @return
     * @throws IOException
     */
    public File getFile() throws IOException;


}
